package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.vo.PropertyScrapVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PropertyScrapMapper;
import com.ruoyi.system.domain.PropertyScrap;
import com.ruoyi.system.service.IPropertyScrapService;

/**
 * 资产报废记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-08
 */
@Service
public class PropertyScrapServiceImpl implements IPropertyScrapService 
{
    @Autowired
    private PropertyScrapMapper propertyScrapMapper;

    /**
     * 查询资产报废记录
     * 
     * @param id 资产报废记录主键
     * @return 资产报废记录
     */
    @Override
    public PropertyScrap selectPropertyScrapById(Long id)
    {
        return propertyScrapMapper.selectPropertyScrapById(id);
    }

    /**
     * 查询资产报废记录列表
     * 
     * @param propertyScrap 资产报废记录
     * @return 资产报废记录
     */
    @Override
    public List<PropertyScrapVo> selectPropertyScrapList(PropertyScrapVo propertyScrap)
    {
        return propertyScrapMapper.selectPropertyScrapList(propertyScrap);
    }

    /**
     * 新增资产报废记录
     * 
     * @param propertyScrap 资产报废记录
     * @return 结果
     */
    @Override
    public int insertPropertyScrap(PropertyScrap propertyScrap)
    {
        propertyScrap.setCreateTime(DateUtils.getNowDate());
        return propertyScrapMapper.insertPropertyScrap(propertyScrap);
    }

    /**
     * 修改资产报废记录
     * 
     * @param propertyScrap 资产报废记录
     * @return 结果
     */
    @Override
    public int updatePropertyScrap(PropertyScrap propertyScrap)
    {
        propertyScrap.setUpdateTime(DateUtils.getNowDate());
        return propertyScrapMapper.updatePropertyScrap(propertyScrap);
    }

    /**
     * 批量删除资产报废记录
     * 
     * @param ids 需要删除的资产报废记录主键
     * @return 结果
     */
    @Override
    public int deletePropertyScrapByIds(Long[] ids)
    {
        return propertyScrapMapper.deletePropertyScrapByIds(ids);
    }

    /**
     * 删除资产报废记录信息
     * 
     * @param id 资产报废记录主键
     * @return 结果
     */
    @Override
    public int deletePropertyScrapById(Long id)
    {
        return propertyScrapMapper.deletePropertyScrapById(id);
    }
}
